<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="CustomizationProject14HIVE" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.microsoft.com/pag/gax-core"
    Bound="false">
  <xi:include href="../../../TypeAlias.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
  <Caption>Sharepoint 2010 Solution Package (.wsp)</Caption>
  <Description>Creates a new SharePoint 2010 solution project (.wsp) with Hive template format.</Description>
	<HostData Priority="100">
    <Icon File="spsf.ico" />
    <CommandBar Menu="SPSFSolutionProjects" />
    <CommandBar Menu="SPSFSolutionFolderProjects" />
    <spsf:MetaData
      Visible="true"
			BindingType="AddProjectReference"
      BindingTypeTemplate="AddProjectReferenceTemplate"
      TemplatePath="Projects\WSP\Root14HIVE.vstemplate"
      Enabled="true"
	  ExcludeFromTests="true"
      SharePointVersions="14"
      VSTemplate="HIVE"
      CreateVSTemplate="false"
      Category="Projects" xmlns:spsf="http://www.spalmblogger.de">
      <spsf:Authors>
        <spsf:Author>Torsten Mandelkow</spsf:Author>
      </spsf:Authors>
      <spsf:VersionHistory>
        <spsf:VersionHistoryEntry>1.0 Initial Recipe</spsf:VersionHistoryEntry>
      </spsf:VersionHistory>
      <spsf:WebPageContent>
        <![CDATA[A customation project is the core wsp solution project type to deploy a .wsp solution to SharePoint.]]>
      </spsf:WebPageContent>
    </spsf:MetaData>
  </HostData>
  <Arguments>

    <Argument Name="VisualStudioVersion" Required="true">
      <ValueProvider Type="VisualStudioVersionProvider" />
    </Argument>
    <Argument Name="SharePointVersion" Required="true">
      <ValueProvider Type="Evaluator" Expression="14" />
    </Argument>

		<Argument Name="RecipeName">
			<ValueProvider Type="Evaluator" Expression="CustomizationProject" />
		</Argument>

		<Argument Name="AppName" Required="true">
      <ValueProvider Type="ApplicationNameProvider" />
    </Argument>
		<Argument Name="AppVersion" Required="true">
			<ValueProvider Type="ApplicationConfigValueProvider" ConfigValue="ApplicationVersion" DefaultValue="1.0.0.0" />
		</Argument>
		<Argument Name="AutoGenerateManifest" Type="System.Boolean" Required="true">
			<ValueProvider Type="ApplicationConfigValueProvider" ConfigValue="AutoGenerateManifest" DefaultValue="true" />
		</Argument>
    <Argument Name="DebuggingWebApp" Required="false">
      <ValueProvider Type="DebuggingWebAppProvider" />
    </Argument>    

    <Argument Name="ProjectID1" Required="true">
      <ValueProvider Type="GuidValueProvider" />
    </Argument>

		<Argument Name="WSPSolutionSignAssembly" Type="System.Boolean" Required="true">
      <ValueProvider Type="SolutionKeyFilenameExistsProvider" />
    </Argument>
    <Argument Name="WSPSolutionKeyFileName" Required="true">
      <ValueProvider Type="SolutionKeyFilenameProvider" />
    </Argument>
    
    <Argument Name="WSPProjectName" Required="true">
      <Converter Type="NamespaceStringConverter" />
      <ValueProvider Type="VisualStudioCreateProjectName" />
    </Argument>
		<Argument Name="WSPProjectNameTemp">
			<ValueProvider Type="Evaluator" Expression="$(AppName).$(WSPProjectName).wsp">
				<MonitorArgument Name="WSPProjectName" />
			</ValueProvider>
		</Argument>
    <Argument Name="WSPSolutionID" Required="true">
      <ValueProvider Type="SPALM.SharePointSoftwareFactory.Library.ValueProviders.GuidValueProvider, SPALM.SharePointSoftwareFactory.Library" />
    </Argument>
    <Argument Name="WSPDeploymentServerType" Required="true">
      <Converter Type="SPALM.SharePointSoftwareFactory.Library.Converters.SolutionDeploymentServerTypeConverter, SPALM.SharePointSoftwareFactory.Library" />
      <ValueProvider Type="Evaluator" Expression="WebFrontEnd" />
    </Argument>
    <Argument Name="WSPDeploymentTarget" Required="true">
      <Converter Type="SPALM.SharePointSoftwareFactory.Library.Converters.SolutionDeploymentTargetConverter, SPALM.SharePointSoftwareFactory.Library" />
      <ValueProvider Type="Evaluator" Expression="GlobalAssemblyCache" />
    </Argument>
    <Argument Name="WSPResetServer" Type="System.Boolean" Required="true">
    </Argument>

    <Argument Name="SPSFBranding" >
      <ValueProvider Type="BrandingImageProvider" Logo="\Branding\Logo.jpg" />
    </Argument>
    <Argument Name="IsSandBoxedSolution" Type="System.Boolean" Required="true">
      <ValueProvider Type="Evaluator" Expression="false" />
    </Argument>

	  <Argument Name="WSPFileName">
		  <ValueProvider Stage="OnBeforeActions" Type="Evaluator" Expression="$(AppName).$(WSPProjectName)" />
	  </Argument>
    
  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Height="350">
          <Title>SharePoint WSP Information</Title>
          <LinkTitle>WSP Solution</LinkTitle>
          <Help>
            Enter the WSP Solution Name.
          </Help>
          <Fields>
            <Field Label="Branding" ValueName="SPSFBranding" PanelType="SPALM.SharePointSoftwareFactory.Library.BrandingPanel, SPALM.SharePointSoftwareFactory.Library" />
						<Field ValueName="WSPProjectNameTemp" ReadOnly="true" Label="Final WSP Solution Filename">
							<Help>Optional String. Displays the final name of the wsp solution file</Help>
						</Field>
            <Field ValueName="WSPProjectName" ReadOnly="true" Label="Solution Name">
              <Help>Required String. Name of the project without full namespace.</Help>
            </Field>
						<Field ValueName="WSPDeploymentServerType" Label="Deployment Server Type">
							<Help>Optional String. Specifies the type of deployment server.</Help>
						</Field>
						<Field ValueName="WSPDeploymentTarget" Label="Deployment Target">
							<Help>Optional String. Specifies the deployment target.</Help>
						</Field>
						<Field ValueName="WSPResetServer" Label="Reset Webserver">
							<Help>Optional Boolean. If checked the option "ResetWebServer" in the solution manifest is set to TRUE.</Help>
						</Field>
            <!-- Sandbox not supported in HIVE template
            <Field ValueName="IsSandBoxedSolution" Label="Sandboxed solution">
              <Help>Optional Boolean. If checked a sandboxed solutions will be created.</Help>
            </Field>
            -->
          </Fields>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>

	<Actions CoordinatorServiceType="ConditionalCoordinator">

		<Action Name="GenerateManifestTT" Template="Text\manifest.tt.t4" Type="TextTemplateAction">
			<Input Name="WSPSolutionID" RecipeArgument="WSPSolutionID" />
			<Input Name="WSPDeploymentServerType" RecipeArgument="WSPDeploymentServerType" />
			<Input Name="WSPResetServer" RecipeArgument="WSPResetServer" />
      <Input Name="IsSandBoxedSolution" RecipeArgument="IsSandBoxedSolution" />
      <Input Name="SharePointVersion" RecipeArgument="SharePointVersion" />
			<Output Name="Content" />
		</Action>	
		<Action Name="AddManifestTT" Condition="$(AutoGenerateManifest)" Type="AddItemToProjectByName" TargetFileName="manifest.tt">
			<Input Name="Content" ActionOutput="GenerateManifestTT.Content" />
			<Input Name="ProjectName" RecipeArgument="WSPProjectName" />
		</Action>

		<Action Name="GenerateDDFTT" Template="Text\makecab.tt.t4" Type="TextTemplateAction">
			<Input Name="WSPFileName" RecipeArgument="WSPFileName" />
			<Output Name="Content" />
		</Action>
		<Action Name="AddDDFTT" Condition="$(AutoGenerateManifest)" Type="AddItemToProjectByName" TargetFileName="makecab.tt">
			<Input Name="Content" ActionOutput="GenerateDDFTT.Content" />
			<Input Name="ProjectName" RecipeArgument="WSPProjectName" />
		</Action>

    <!-- Settings the site url in all projects -->
    <Action
      Name="SetSiteUrl"
      Type="SetSiteUrl">
      <Input Name="SiteUrl" RecipeArgument="DebuggingWebApp" />
      <Input Name="CurrentProjectName" RecipeArgument="WSPProjectName" />
    </Action>
    <Action
      Name="SetDeploymentTarget"
      Type="SetDeploymentTarget">
      <Input Name="DeploymentTarget" RecipeArgument="WSPDeploymentTarget" />
      <Input Name="CurrentProjectName" RecipeArgument="WSPProjectName" />      
    </Action>

		<Action Name="MoveProjectToSolutionFolder"
		  SolutionFolder="Solutions"
		  Type="MoveProjectToSolutionFolder" >
			<Input Name="ProjectName" RecipeArgument="WSPProjectName" />
		</Action>
			
	</Actions>
</Recipe>